﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Amazon.Route53.DataContracts
{
    /// <summary>
    /// Describes change information about changes made to your hosted zone.
    ///This element contains an ID that you use when performing a GetChange action 
    ///to get detailed information about the change.
    /// </summary>
    [DataContract(Namespace = Constants.Namespace)]
    public class ChangeInfo
    {
        /// <summary>
        /// The ID of the request. Use this ID to track when the change has 
        /// completed across all Amazon Route 53 DNS servers.
        /// </summary>
        [DataMember(Order=1)]
        public String Id { get; set; }

        /// <summary>
        /// The current state of the hosted zone. 
        /// PENDING indicates that this request has not yet been applied 
        /// to all Amazon Route 53 DNS servers.
        /// </summary>
        [DataMember(Order=2)]
        public ChangeStatus Status { get; set; }

        /// <summary>
        /// The date and time the change was made.
        /// </summary>
        [DataMember(Name = "SubmittedAt", Order = 3)]
        private String _SubmittedAt
        {
            get
            {
                return SubmittedAt.ToString(Amazon.Util.AWSSDKUtils.ISO8601DateFormat);
            }
            set
            {
                SubmittedAt = DateTime.ParseExact(value, Amazon.Util.AWSSDKUtils.ISO8601DateFormat
                    , System.Globalization.DateTimeFormatInfo.CurrentInfo);
            }
        }
        public DateTime SubmittedAt { get; set; }
         

    }

    public enum ChangeStatus
    {
        PENDING,
        INSYNC,
    }
}
